package com.bonana.core.dao.user;

import com.bonana.core.entity.CoreUser;
import com.bonana.core.entity.CoreUserProfile;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by justin on 15/8/14.
 */
@Repository
public interface CoreUserProfileDAO {

    int isExists(@Param("uid") int uid);

    int save(CoreUserProfile coreUserProfile);

    int updateUserProfile(CoreUserProfile coreUserProfile);

    int updateUserAvatar(@Param("uid") int uid,@Param("avatarFileUrl") String avatarFileUrl);

    /**
     * 查询简单用户信息：uid、nickname、gender、avatar
     * @param uid
     * @return
     */
    CoreUserProfile queryBaseProfileByUid(@Param("uid") int uid);

    CoreUserProfile queryProfileByUid(@Param("uid")int uid,@Param("ts") Timestamp ts);

    List<CoreUserProfile> queryUserProfileByUids(List<Integer> uidList);

    int updateSingleField(@Param("uid") int uid, @Param("field") String field, @Param("val") String val);

    /**
     * 查询系统预留用户帐号
     */
    List<CoreUserProfile> queryRobotUserPage(int pgSize, int pgNum, String queryString);

    List<CoreUserProfile> queryAllRobotUser();

    String queryNameByUid(int uid);

    List<CoreUserProfile> getBobos(@Param("myorder") String myorder, @Param("queryString") String queryString, @Param("owner") Integer owner,
                                   @Param("platformId") Integer platformId);

    int DelBoboProfile(@Param("uid") int uid);

    int updateFavour(@Param("uid") int uid, @Param("likeCnt") int likeCnt);

    int updateFollowerCnt(@Param("uid") int uid, @Param("cnt") int cnt);

    int updateFollowingCnt(@Param("uid") int uid, @Param("cnt") int cnt);
}
